//
//  ContactModel.m
//  Address-book
//
//  Created by 任伟 on 16/1/3.
//  Copyright © 2016年 任伟. All rights reserved.
//

#import "ContactModel.h"

@implementation ContactModel

- (void)encodeWithCoder:(NSCoder*)coder
{
    // 归档属性
    [coder encodeObject:_name forKey:@"name"];
    [coder encodeObject:_number forKey:@"number"];
}

- (instancetype)initWithCoder:(NSCoder*)coder
{
    // 解档属性
    self = [super init];
    if (self) {
        _name = [coder decodeObjectForKey:@"name"];
        _number = [coder decodeObjectForKey:@"number"];
    }
    return self;
}

@end
